﻿using System.Collections.Generic;

namespace XTeam.Core.Helper
{
    public class DictionaryEx<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public TValue this[TKey key]
        {
            get
            {
                TValue value;
                if (!base.TryGetValue(key, out value))
                {
                    value = default(TValue);
                }
                return value;
            }
            set
            {
                base[key] = value;
            }
        }
    }
}
